Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 828 Bytes

Is Mockito Working Fine.rst

File metadata and controls

33 lines (23 loc) · 828 Bytes

Is Mockito Working Fine?

Definition:

  • When the mock framerwork is tested intead of the SUT

Code Example:

@Test
public void testFormUpdate() {
  // given
  Form f = Mockito.mock(Form.class);
  Mockito.when(f.isUpdateAllowed()).thenReturn(true);
  // when
  boolean result = f.isUpdateAllowed();
  // then
  assertTrue(result);
}

References:

Quality attributes